home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Disc to the Future 2
/
Disc to the Future Part II Programmer's Reference (Wayzata Technology)(6013)(1992).bin
/
MAC
/
THINKC
/
5
/
TIME_ZON
/
COAPP.C
< prev
next >
Wrap
Text File
|
1991-11-08
|
2KB
|
162 lines
/*****
* COApp.c
*
* Application methods for a typical application.
*
* Copyright ⌐ 1990 Symantec Corporation. All rights reserved.
*
*****/
#include "COApp.h"
#include "CODoc.h"
#include <Quickdraw.h>
extern OSType gSignature;
#define kExtraMasters 4
#define kRainyDayFund 20480
#define kCriticalBalance 20480
#define kToolboxBalance 20480
/***
* IOApp
*
***/
void COApp::IOApp(void)
{
CApplication::IApplication( kExtraMasters, kRainyDayFund,
kCriticalBalance, kToolboxBalance);
}
/***
* SetUpFileParameters
*
***/
void COApp::SetUpFileParameters(void)
{
inherited::SetUpFileParameters(); /* Be sure to call the default method */
sfNumTypes = 1;
sfFileTypes[0] = 'TEXT';
gSignature = 'ccTZ';
}
/***
* SetUpMenus
*
***/
void COApp::SetUpMenus()
{
inherited::SetUpMenus(); /* Superclass takes care of adding
menus specified in a MBAR id = 1
resource
*/
}
/***
* DoCommand
*
***/
void COApp::DoCommand(long theCommand)
{
switch (theCommand) {
case cmdAbout:
ShowAbout();
break;
default: inherited::DoCommand(theCommand);
break;
}
}
/***
*
* UpdateMenus
*
***/
void COApp::UpdateMenus()
{
inherited::UpdateMenus(); /* Enable standard commands */
}
/***
* Exit
*
***/
void COApp::Exit()
{
}
/***
* CreateDocument
*
***/
void COApp::CreateDocument()
{
CODoc *theDocument = NULL;
TRY
{
theDocument = new(CODoc);
theDocument->IODoc(this, FALSE);
}
CATCH
{
if (theDocument) theDocument->Dispose();
}
ENDTRY;
}
void
COApp::ShowAbout()
{
DialogPtr theDlg;
int which;
GrafPtr save;
theDlg = GetNewDialog(129,NULL,(WindowPtr) -1);
GetPort(&save);
SelectWindow(theDlg);
ShowWindow(theDlg);
SetPort(theDlg);
ModalDialog(NULL,&which);
DisposDialog(theDlg);
SetPort(save);
}